package com.koron.tool.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: laiguangming
 * @Date: 2022/10/24 16:50
 */
@Getter
@AllArgsConstructor
public enum WarningReasonEnum {

    /**
     * 预警原因：到达检验期
     */
    REACH_THE_INSPECTION_PERIOD(1, "即将到达检验期"),

    /**
     * 预警原因：到达报废期
     */
    REACH_THE_SCRAP_PERIOD(2, "即将到达报废期"),

    /**
     * 预警原因：盘点账物不一致
     */
    INCONSISTENT_INVENTORY(3, "盘点账物不符"),

    /**
     * 预警原因：到达盘点期
     */
    REACT_THE_INVENTORY_PERIOD(4, "即将到达盘点期");

    private Integer reason;

    private String reasonDescription;

    /**
     * 获取枚举的 Map, Entry(reason, reasonDescription)
     * @return
     */
    public static Map<Integer, String> getWarningReasonMap() {
        Map<Integer, String> map = new HashMap<>();
        WarningReasonEnum[] enums = WarningReasonEnum.values();
        for (WarningReasonEnum warningReasonEnum : enums) {
            map.put(warningReasonEnum.getReason(), warningReasonEnum.getReasonDescription());
        }
        return map;
    }


}
